<template>
  <div>
    <div class="category-header">
      <div class="category-fanhui">
        <span class="iconfont icon-jiantouzuo" style="color:white" @click="signOut"></span>
      </div>
      <div class="category-title" v-show="false">最受欢迎</div>
    </div>
    <div class="category">
      <div class="category-pic">
        <img src="../assets/img/02.jpg" width="100%" alt="" />
        <h2>最受欢迎</h2>
      </div>
    </div>

    <div class="category-list">
      <ul>
        <li>
          <div class="category-img">
            <img src="../assets/img/02.jpg" alt="" />
          </div>
          <div class="category-text">
            <p>吐司吐司吐司吐司吐司吐司吐司吐司吐司</p>
            <p>7天内 39人做过</p>
            <div class="category-user">
              <div class="category-user-img">
                <img src="../assets/img/touxiang.jpg" alt="" />
              </div>
              <p>神经病</p>
            </div>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
    methods:{
        signOut(){
            this.$emit("signOut")
            this.$router.push('homeView')
        }
    }
};
</script>

<style lang="scss" scoped>
.category-header {
  padding: 0 20px;
  height: 60px;
  display: flex;
  background-color: transparent;
  align-items: center;
  .category-title {
    margin-left: 35%;
  }
}
.category {
  .category-pic {
    position: relative;
    height: 200px;
    width: 100%;
    overflow: hidden;
    margin-top: -60px;
    z-index: -1;
    h2 {
      position: absolute;
      bottom: 60px;
      left: 20px;
      color: white;
      font-size: 35px;
    }
  }
}

.category-list {
    margin-top: 20px;
  padding: 0 20px;
  ul {
    li {
      height: 125px;
      display: flex;
      .category-img {
        width: 160px;
        height: 125px;
        border-radius: 16px;
        overflow: hidden;
        margin-right: 10px;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .category-text {
        width: 134px;
        padding-top: 10px;
        p {
          &:nth-child(1) {
            text-overflow: -o-ellipsis-lastline;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
          }
          &:nth-child(2) {
            font-size: 12px;
            margin-top: 10px;
            margin-bottom: 20px;
          }
        }
        .category-user {
          display: flex;
          align-items: center;
          .category-user-img {
            width: 16px;
            height: 16px;
            border-radius: 50%;
            overflow: hidden;
            margin-right: 3px;
          }
        }
      }
    }
  }
}
</style>